<?php

namespace App\Http\Controllers\Chanjet;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class TplusTransferOrder extends BaseController
{
    protected static $Field = [
        "voucher_id" => "TransVoucher.ID",
        "voucher_code" => "TransVoucher.Code",
        "voucher_date" => "TransVoucher.VoucherDate",
        "voucher_time|int" => "TransVoucher.VoucherDate",

        "business_type" => "TransVoucher.BusiType.Name",
        "bring_warehouse" => "TransVoucher.OutWarehouse.Name",//调出仓库名称
        "pull_warehouse" => "TransVoucher.InWarehouse.Name",//调入仓库名称
    ];

    public $config = [
        "code" => "TransVoucher",
        "Model" => "TplusTransferOrder",
        "ListModel" => "TplusTransferOrder",
        "InfoModel" => "TplusTransferOrderInfo",
        "queryApi" => "TransVoucherOpenApiFindVoucherList",
    ];
    public function getExternalData(){
        $common = new TplusCommonController();
        $res = $common->getExternalData("TplusTransferOrder",$this->mangerinfo['org_id']);
        return $res;
    }
    public function getlist(Request $request)
    {
        $memberinfo = $this->mangerinfo;
        $isgetall = $request->isgetall ?? 0;
        $list = \App\Models\Chanjet\TplusTransferOrder::getList($request, $memberinfo, $isgetall);
        return response()->json(['code' => '000', 'msg' => '操作成功', 'data' => $list]);
    }
}
